import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// svg图标
import SvgIcon from 'vue-svgicon'

import '@/icons/components'

// import Router from 'vue-router'

// const originalPush = Router.prototype.push
// Router.prototype.push = function push(localtion){
//   return originalPush.call(this,localtion).catch(err=>err)
// }

import '@/filters/index'
import {directives} from '@/directives/index.ts'

Object.keys(directives).forEach((e, v) => {
  Vue.directive(e, directives[e])
})

// 导航进度条
import "./router/navigation"
// element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; 
import wsConnection from './unit/webSocket.ts';

import style from '@/style/index.scss'

Vue.config.productionTip = false

Vue.prototype.$Ws = wsConnection

Vue.use(ElementUI);
Vue.use(SvgIcon, {
  tagName: 'svg-icon',
  defaultWidth: '1em',
  defaultHeight: '1em'
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
